/*#ifndef  CONTROL_CONFIG_HPP
# define CONTROL_CONFIG_HPP

# include <Shinygami/controlregister.hpp>
# include <Shinygami/container.hpp>

namespace Shiny
{
    std::string        key2string(const sf::Keyboard::Key key);
    sf::Keyboard::Key  string2key(const std::string str);

    template<typename T>
    struct Control
    {
	enum EventType
	{
	    Pressed,
	    Released
	};

	typename ControlRegister<T>::ControlHandler::Callback callback;
	EventType                                             type;
	std::string                                           name;

	Control(const std::string& name, typename ControlRegister<T>::ControlHandler::Callback callback, EventType type)
	{
	    this->callback = callback;
	    this->type     = type;
	    this->name     = name;
	}

	typename ControlRegister<T>::ControlHandler CreateHandler(sf::Keyboard::Key key)
	{
	    sf::Event::EventType eventType;

	    switch (type)
	    {
	    case Pressed:
		eventType = sf::Event::KeyPressed;
		break ;
	    case Released:
		eventType = sf::Event::KeyReleased;
		break ;
	    }
	    return (typename ControlRegister<T>::ControlHandler(callback, eventType, key));
	}

	typename ControlRegister<T>::ControlHandler CreateHandler(unsigned int joystick, unsigned int button)
	{
	    sf::Event::EventType eventType;

	    switch (eventType)
	    {
	    case Pressed:
		eventType = sf::Event::JoystickButtonPressed;
		break ;
	    case Released:
		eventType = sf::Event::JoystickButtonReleased;
		break ;
	    }
	    return (typename ControlRegister<T>::ControlHandler(callback, eventType, joystick, button));
	}
    };

    class ConfiguredControl
    {
    public:
	enum Controller
	{
	    Joystick,
	    Keyboard
	};

	ConfiguredControl(void) {}
	ConfiguredControl(const Data data);
	ConfiguredControl(unsigned int joystick, unsigned int button) : type(Joystick), joystick(joystick), button(button) {}
	ConfiguredControl(sf::Keyboard::Key key) : type(Keyboard), key(key) {}

	template<typename T>
	typename ControlRegister<T>::ControlHandler CreateHandler(Control<T> control)
	{
	    switch (type)
	    {
	    case Joystick:
		return (control.CreateHandler(joystick, button));
	    case Keyboard:
		return (control.CreateHandler(key));
	    }
	}

    private:
	Controller        type;
	unsigned int      joystick;
	unsigned int      button;
	sf::Keyboard::Key key;
    };

    namespace Widgets
    {
	class ControlEditorItem : public Shiny::Widgets::TextWidget
	{
	public:
	    ControlEditorItem(const std::string& name) : _name(name)
	    {
		SetText(name);
	    }

	    void    OtherEvents(const sf::Event event)
	    {
		std::cout << "OTHER EVENTS TRIGGERED" << std::endl;
		if (event.Type == sf::Event::KeyReleased)
		{
		    _control = event;
		    SetText(_name + ": " + key2string(event.Key.Code));
		}
	    }

	    sf::Event GetControl(void) const { return _control; }

	private:
	    sf::Event         _control;
	    const std::string _name;
	};

	class ControlEditor : public Shiny::Widgets::WidgetList
	{
	public:
	    template<typename T>
	    void    GenerateControlList(Control<T>* controls)
	    {
		for (short i = 0 ; controls[i].callback != 0 ; ++i)
		{
		    Shiny::Widgets::TextWidget* widget = new ControlEditorItem(controls[i].name);

		    widget->SetMouseAwareness(Shiny::Widgets::Container::MouseClick);
		    this->AddWidget(widget);
		}
	    }

	    std::vector<ConfiguredControl> GetControls(void);
	};
    }
}

#endif
*/
